// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
const apiPrefix = '/web';

/** 新增设备信息 新增设备信息 POST /station/device/add */
export async function stationDeviceControllerAddDevice(
  body: API.StationDeviceReq,
  options?: { [key: string]: any },
) {
  return request<boolean>(`${apiPrefix}/station/device/add`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 批量操作 批量操作 DELETE /station/device/batch/remove */
export async function stationDeviceControllerBatch(
  body: number[],
  options?: { [key: string]: any },
) {
  return request<API.ApiResultVoid>(`${apiPrefix}/station/device/batch/remove`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 导出数据 导出数据 GET /station/device/download/excel */
export async function stationDeviceControllerDownloadExcel(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.stationDeviceControllerDownloadExcelParams,
  options?: { [key: string]: any },
) {
  return request<any>(`${apiPrefix}/station/device/download/excel`, {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 编辑设备信息 编辑设备信息 POST /station/device/edit */
export async function stationDeviceControllerEditDevice(
  body: API.StationDeviceReq,
  options?: { [key: string]: any },
) {
  return request<boolean>(`${apiPrefix}/station/device/edit`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 分页查询 分页查询数据 GET /station/device/list */
export async function stationDeviceControllerList(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.stationDeviceControllerListParams,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultPaginationStationDeviceResp>(`${apiPrefix}/station/device/list`, {
    method: 'GET',
    params: {
      ...params,
      page: undefined,
      ...params['page'],
    },
    ...(options || {}),
  });
}

/** 删除数据 删除数据 DELETE /station/device/remove/${param0} */
export async function stationDeviceControllerRemove(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.stationDeviceControllerRemoveParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.ApiResultVoid>(`${apiPrefix}/station/device/remove/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 导入文件 导入文件数据 POST /station/device/upload/excel */
export async function stationDeviceControllerUploadExcel(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.stationDeviceControllerUploadExcelParams,
  body: {},
  options?: { [key: string]: any },
) {
  return request<API.ApiResultVoid>(`${apiPrefix}/station/device/upload/excel`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    params: {
      ...params,
    },
    data: body,
    ...(options || {}),
  });
}

/** 新增电站设备 新增电站设备 POST /v1/station-devices */
export async function stationSelfDeviceControllerImplAddStationDevice(
  body: API.StationDeviceAddDTO,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultStationDeviceDTO>(`${apiPrefix}/v1/station-devices`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询电站设备 查询电站设备 GET /v1/station-devices/${param0} */
export async function stationSelfDeviceControllerImplShowStationDevice(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.stationSelfDeviceControllerImplShowStationDeviceParams,
  options?: { [key: string]: any },
) {
  const { device_id: param0, ...queryParams } = params;
  return request<API.ApiResultStationDeviceDTO>(`${apiPrefix}/v1/station-devices/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 更新电站设备 更新电站设备 PUT /v1/station-devices/${param0} */
export async function stationSelfDeviceControllerImplUpdateStationDevice(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.stationSelfDeviceControllerImplUpdateStationDeviceParams,
  body: API.StationDeviceUpdateDTO,
  options?: { [key: string]: any },
) {
  const { device_id: param0, ...queryParams } = params;
  return request<API.ApiResultStationDeviceDTO>(`${apiPrefix}/v1/station-devices/${param0}`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}

/** 删除电站设备 删除电站设备 DELETE /v1/station-devices/${param0} */
export async function stationSelfDeviceControllerImplDeleteStationDevice(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.stationSelfDeviceControllerImplDeleteStationDeviceParams,
  options?: { [key: string]: any },
) {
  const { device_id: param0, ...queryParams } = params;
  return request<API.ApiResultVoid>(`${apiPrefix}/v1/station-devices/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}
